﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace SerializeProject.Helpers
{
    public static class AssemblyExtension
    {
        public static string AssemblyInf(this string fullname,AssemblyInformation assemblyInformation)
        {
            string []fullnameArray = fullname.Split(new char[]{',','"'});
            switch (assemblyInformation)
            {
                case AssemblyInformation.Name:
                    return fullnameArray[0];
                case AssemblyInformation.Version:
                    return fullnameArray[1];
                case AssemblyInformation.PublicKeyToken:
                    return fullnameArray[2];
                default:
                    return fullnameArray[0];
            }
        }
    }

    public enum AssemblyInformation
    {
        Name,Version,PublicKeyToken
    };
}
